package com.rongmai.web.bo;

import com.rongmai.db.mapper.CompanyRoleMapper;
import com.rongmai.db.model.CompanyRole;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class CompanyRoleBo {

    @Resource
    private CompanyRoleMapper companyRoleMapper;

    public CompanyRole query(Integer companyId, String role) {

        return companyRoleMapper.query(companyId, role);
    }

    public void save(CompanyRole companyRole) {
        companyRoleMapper.insert(companyRole);
    }

    public void update(CompanyRole companyRole) {
        companyRoleMapper.updateByPrimaryKeySelective(companyRole);
    }

    public List<CompanyRole> queryByCompanyId(Integer companyId) {
        List<CompanyRole> companyRoleList = companyRoleMapper.queryByCompanyId(companyId);
        return companyRoleList;
    }
}
